/*
day200
2020.3.15
*/ 
#include<iostream>
#include<cstdlib>
using namespace std;


struct ListNode {
    int val;
    ListNode *next;
    ListNode(int x) : val(x), next(NULL) {}
};

class Solution {
public:
    int kthToLast(ListNode* head, int k) {
		struct ListNode *l1=head,*l2=head;
		for(int i=0;i<k-1;++i)
		{
			l2=l2->next;
		}
		
		while(l2->next)
		{
			l2=l2->next;
			l1=l1->next;
		}
		
		return l1->val;
    }
};

int main()
{
	return 0;
}
